import React, { Component } from 'react'

export default class Picture extends Component {

    render() {
        //获取图片的路径
        let {src} = this.props;
        return (
            <div>
                <img onClick={this.change} src={src} width="500" alt="" />
            </div>
        )
    }

    change = () => {
        //执行父级组件传入的 change 函数
        this.props.change()
    }

}
